<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>表单操作</title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<style>

		</style>
	</head>
	<body>
		<div id="app">
			<input type="text" placeholder="输入用户名" v-model.lazy="uname"> <br>
			<h4>{{uname}}</h4>
			<input type="text" v-model.number='num1'>+
			<input type="text" v-model.number='num2'>= {{num1+num2}}
			<h4>单选框获取数据</h4>
			<input type="radio" value='1' id='male' v-model='gender'> <label for="male">男</label>
			<input type="radio" value='2' id='fmale' v-model='gender'> <label for="male">女</label>
			<h4>复选框获取数据</h4>
			<input type="checkbox" v-model='hobby' value='1' id="fish"> <label for="fish">钓鱼</label>
			<input type="checkbox" v-model='hobby' value='2' id="cooking"> <label for="cooking">煮鱼</label>
			<input type="checkbox" v-model='hobby' value='3' id="eat"> <label for="eat">吃鱼</label>
			<h4>下拉选框</h4>
			<select  v-model="kill">
				<option value="0">---选择战术---</option>
				<option value="1">随机应变</option>
				<option value="2">野区发育</option>
				<option value="3">城区刚强</option>
				<option value="4">极品老六</option>
			</select>
		</div>
		<script>
			//1. 实例化一个Vue的实例
			let vm = new Vue({
				el: '#app',
				data: {
					uname: '',
					num1:'',
					num2:'',
					gender:2,
					hobby:['1','2'],
					kill:'0'
					
				}
			});
		</script>
	</body>
</html>
